20. Magnetometer Errors and Calibration
Nd787 C4 L2 A16 Magnetometer Errors And Calibratio V1
Magnetometer Summary
The magnetometer takes advantage of the fact that the Earth's magnetic field always has a northward component. When we know the roll and pitch of the vehicle we can use this fact to estimate the vehicle's absolute yaw angle relative to magnetic north.
Unlike gravity, the strength of the Earth's magnetic field is very weak and susceptible to distortions. For example, small electrical currents in wires onboard the drone can cause magnetic fields that overpower the Earth's magnetic field.
Distortions aren't the only problem either. The Earth's magnetic field varies in magnitude and declination depending on where on the globe you are.
Taken together, distortions and inconsistencies make the magnetometer measurements very noisy, but often they are the only source of absolute yaw information. We typically use magnetometers as a way to correct for drifting yaw measurements from the gyro.